/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-08-07
 * Time: 23:32
 */
public class TestDemo {
    class Solution {
        public List<String> stringMatching(String[] words) {
            List<String>  tmp=new ArrayList<>();//创建数组
            int n=words.length;//求数组长度
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){

                    if(i!=j&&words[j].contains(words[i])){
                        //子串不等于母串
                        tmp.add(words[i]);
                        break;
                    }
                }
            }
            return tmp;
        }

    }
}
